
#if($initData.id)
<input type="hidden" id="image_id" name="image_id" value="$initData.id">
#else
<input type="hidden" id="image_id" name="image_id" value="">
#end

#if($initData.img_url)
<input type="hidden" id="img_url" name="img_url" value="$initData.img_url">
#else
<input type="hidden" id="img_url" name="img_url" value="">
#end

<div class="form-group">
    <label class="col-sm-3 control-label">标题：</label>
    <div class="col-sm-6">
        #if($initData.title)
        <input type="text" id="image_title" class="form-control" value="$initData.title">
        #else
        <input type="text" id="image_title" class="form-control" value="">
        #end
    </div>
</div>

<div class="form-group">
    <label class="col-sm-3 control-label">简介：</label>
    <div class="col-sm-6">
        #if($initData.article_desc)
        <input type="text" id="article_desc" class="form-control" value="$initData.article_desc">
        #else
        <input type="text" id="article_desc" class="form-control" value="">
        #end
    </div>
</div>



<div class="form-group">
    <label class="col-sm-3 control-label"></label>
    <div class="col-sm-8">
        #if($initData.img_url)
        <img id="indexImg" src="$initData.img_url" style="width: 160px; height: 140px;">
        #else
        <img id="indexImg" src="" style="width: 160px; height: 140px;">
        #end
        <span style="color: red"> 默认大小512*512</span>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label">商品封面图：</label>
    <div class="col-sm-6">


        <div class="col-sm-12 img-add" data-bind="visible: model.formEntity.bannerImgurl().length < 1">
            <div id="container">
                <a class="btn btn-default btn-lg " id="pickfiles" href="#" >
                    <i class="glyphicon glyphicon-plus"></i>
                    <span>选择文件</span>
                </a>
            </div>
             </div>
    </div>
</div>

#if($initData.content)
<div class="form-group">
    <label class="col-sm-3 control-label">内容：</label>
    <div class="col-sm-9">
        <div id="editor-trigger">$initData.content</div>
    </div>
</div>

#else
<div class="form-group">
    <label class="col-sm-3 control-label">内容：</label>
    <div class="col-sm-9">
        <div id="editor-trigger"></div>
    </div>
</div>
#end

<script >

    var editor = new wangEditor('editor-trigger');

    // 上传图片
    editor.config.uploadImgUrl = '/upload';
    editor.config.uploadParams = {
        // token1: 'abcde',
        // token2: '12345'
    };
    editor.config.uploadHeaders = {
        // 'Accept' : 'text/x-json'
    }
    // editor.config.uploadImgFileName = 'myFileName';

    // 隐藏网络图片
    // editor.config.hideLinkImg = true;

    // 表情显示项
    editor.config.emotionsShow = 'value';


    // onchange 事件
    editor.onchange = function () {
        console.log(this.$txt.html());
    };

    editor.create();
</script>


<script src="/newshop/artcle/image/addImage.js"></script>